package de.tum.in.eist.im.client;
import de.tum.in.eist.im.client.*;

import com.google.gwt.core.client.EntryPoint;
import com.google.gwt.event.dom.client.ClickEvent;
import com.google.gwt.event.dom.client.ClickHandler;
import com.google.gwt.user.client.ui.Button;
import com.google.gwt.user.client.ui.FlexTable;
import com.google.gwt.user.client.ui.Label;
import com.google.gwt.user.client.ui.PasswordTextBox;
import com.google.gwt.user.client.ui.RootPanel;
import com.google.gwt.user.client.ui.TextBox;

public class Login implements EntryPoint {
	private Button btnLogin;
	private TextBox textBox;
	private PasswordTextBox passwordTextBox;
	
	public void onModuleLoad() {
		RootPanel rootPanel = RootPanel.get();
		
		FlexTable flexTable = new FlexTable();
		rootPanel.add(flexTable, 10, 10);
		flexTable.setSize("430px", "280px");
		
		Label lblNewLabel = new Label("Login EIST IM 16");
		flexTable.setWidget(0, 1, lblNewLabel);
		
		Label lblNewLabel_1 = new Label("Username:");
		flexTable.setWidget(1, 0, lblNewLabel_1);
		
		textBox = new TextBox();
		flexTable.setWidget(1, 1, textBox);
		
		Label lblPassword = new Label("Password:");
		flexTable.setWidget(2, 0, lblPassword);
		
		passwordTextBox = new PasswordTextBox();
		flexTable.setWidget(2, 1, passwordTextBox);
		
		btnLogin = new Button("Login");
		btnLogin.addClickHandler(new ClickHandler() {
			public void onClick(ClickEvent event) {
				User test = new User(textBox.getText());
			}

		});
		flexTable.setWidget(3, 1, btnLogin);
	}
}
